\(\int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx\) [562]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 47 \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=-\frac {A \sqrt {a+b x^2}}{a x}+\frac {B \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}} \]

[Out]

B*arctanh(x*b^(1/2)/(b*x^2+a)^(1/2))/b^(1/2)-A*(b*x^2+a)^(1/2)/a/x

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {462, 223, 212} \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=\frac {B \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}}-\frac {A \sqrt {a+b x^2}}{a x} \]

[In]

Int[(A + B*x^2)/(x^2*Sqrt[a + b*x^2]),x]

[Out]

-((A*Sqrt[a + b*x^2])/(a*x)) + (B*ArcTanh[(Sqrt[b]*x)/Sqrt[a + b*x^2]])/Sqrt[b]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 462

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[c*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] + Dist[d/e^n, Int[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a,
 b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n*(p + 1) + 1, 0] && (IntegerQ[n] || GtQ[e, 0]) && (
(GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1]))

Rubi steps \begin{align*} \text {integral}& = -\frac {A \sqrt {a+b x^2}}{a x}+B \int \frac {1}{\sqrt {a+b x^2}} \, dx \\ & = -\frac {A \sqrt {a+b x^2}}{a x}+B \text {Subst}\left (\int \frac {1}{1-b x^2} \, dx,x,\frac {x}{\sqrt {a+b x^2}}\right ) \\ & = -\frac {A \sqrt {a+b x^2}}{a x}+\frac {B \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.06 \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=-\frac {A \sqrt {a+b x^2}}{a x}-\frac {B \log \left (-\sqrt {b} x+\sqrt {a+b x^2}\right )}{\sqrt {b}} \]

[In]

Integrate[(A + B*x^2)/(x^2*Sqrt[a + b*x^2]),x]

[Out]

-((A*Sqrt[a + b*x^2])/(a*x)) - (B*Log[-(Sqrt[b]*x) + Sqrt[a + b*x^2]])/Sqrt[b]

Maple [A] (verified)

Time = 2.79 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.87

method result size
default \(\frac {B \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{\sqrt {b}}-\frac {A \sqrt {b \,x^{2}+a}}{a x}\) \(41\)
risch \(\frac {B \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{\sqrt {b}}-\frac {A \sqrt {b \,x^{2}+a}}{a x}\) \(41\)
pseudoelliptic \(-\frac {-B a \,\operatorname {arctanh}\left (\frac {\sqrt {b \,x^{2}+a}}{x \sqrt {b}}\right ) x +A \sqrt {b \,x^{2}+a}\, \sqrt {b}}{x \sqrt {b}\, a}\) \(49\)

[In]

int((B*x^2+A)/x^2/(b*x^2+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

B*ln(x*b^(1/2)+(b*x^2+a)^(1/2))/b^(1/2)-A*(b*x^2+a)^(1/2)/a/x

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 109, normalized size of antiderivative = 2.32 \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=\left [\frac {B a \sqrt {b} x \log \left (-2 \, b x^{2} - 2 \, \sqrt {b x^{2} + a} \sqrt {b} x - a\right ) - 2 \, \sqrt {b x^{2} + a} A b}{2 \, a b x}, -\frac {B a \sqrt {-b} x \arctan \left (\frac {\sqrt {-b} x}{\sqrt {b x^{2} + a}}\right ) + \sqrt {b x^{2} + a} A b}{a b x}\right ] \]

[In]

integrate((B*x^2+A)/x^2/(b*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

[1/2*(B*a*sqrt(b)*x*log(-2*b*x^2 - 2*sqrt(b*x^2 + a)*sqrt(b)*x - a) - 2*sqrt(b*x^2 + a)*A*b)/(a*b*x), -(B*a*sq
rt(-b)*x*arctan(sqrt(-b)*x/sqrt(b*x^2 + a)) + sqrt(b*x^2 + a)*A*b)/(a*b*x)]

Sympy [A] (verification not implemented)

Time = 0.62 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.49 \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=- \frac {A \sqrt {b} \sqrt {\frac {a}{b x^{2}} + 1}}{a} + B \left (\begin {cases} \frac {\log {\left (2 \sqrt {b} \sqrt {a + b x^{2}} + 2 b x \right )}}{\sqrt {b}} & \text {for}\: a \neq 0 \wedge b \neq 0 \\\frac {x \log {\left (x \right )}}{\sqrt {b x^{2}}} & \text {for}\: b \neq 0 \\\frac {x}{\sqrt {a}} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate((B*x**2+A)/x**2/(b*x**2+a)**(1/2),x)

[Out]

-A*sqrt(b)*sqrt(a/(b*x**2) + 1)/a + B*Piecewise((log(2*sqrt(b)*sqrt(a + b*x**2) + 2*b*x)/sqrt(b), Ne(a, 0) & N
e(b, 0)), (x*log(x)/sqrt(b*x**2), Ne(b, 0)), (x/sqrt(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.70 \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=\frac {B \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {b}} - \frac {\sqrt {b x^{2} + a} A}{a x} \]

[In]

integrate((B*x^2+A)/x^2/(b*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

B*arcsinh(b*x/sqrt(a*b))/sqrt(b) - sqrt(b*x^2 + a)*A/(a*x)

Giac [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.23 \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=-\frac {B \log \left ({\left (\sqrt {b} x - \sqrt {b x^{2} + a}\right )}^{2}\right )}{2 \, \sqrt {b}} + \frac {2 \, A \sqrt {b}}{{\left (\sqrt {b} x - \sqrt {b x^{2} + a}\right )}^{2} - a} \]

[In]

integrate((B*x^2+A)/x^2/(b*x^2+a)^(1/2),x, algorithm="giac")

[Out]

-1/2*B*log((sqrt(b)*x - sqrt(b*x^2 + a))^2)/sqrt(b) + 2*A*sqrt(b)/((sqrt(b)*x - sqrt(b*x^2 + a))^2 - a)

Mupad [B] (verification not implemented)

Time = 5.28 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.85 \[ \int \frac {A+B x^2}{x^2 \sqrt {a+b x^2}} \, dx=\frac {B\,\ln \left (\sqrt {b}\,x+\sqrt {b\,x^2+a}\right )}{\sqrt {b}}-\frac {A\,\sqrt {b\,x^2+a}}{a\,x} \]

[In]

int((A + B*x^2)/(x^2*(a + b*x^2)^(1/2)),x)

[Out]

(B*log(b^(1/2)*x + (a + b*x^2)^(1/2)))/b^(1/2) - (A*(a + b*x^2)^(1/2))/(a*x)